package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author__lzl
 * @version__1.0
 */
@Mapper
public interface DishFlavorMapper {

    /**
     * 批量插入
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据主键删除口味表里的
     *
     */
    @Delete("delete from dish_flavor where dish_id = #{dishid}")
    void deleteById(Long dishid);

    /**
     * 根据主键删除口味表里的
     *
     */
    void deleteByIds(List<Long> dishIds);

    /**
     *根据ID查询到所有口味
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where  dish_id = #{dishId}")
    List<DishFlavor> getByDishId(Long dishId);
}
